var t = getApp();

Page({
    data: {
        list: [],
        option: "",
        urlStr: "plugin.silver-point-pay.frontend.union-card.index"
    },
    onLoad: function(t) {
        wx.setNavigationBarTitle({
            title: "银行卡列表"
        }), "wisdom" == t.option && this.setData({
            option: t.option,
            urlStr: "plugin.eplus-pay.frontend.card.bindCardList"
        }), this.getData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var n = this;
        t._getNetWork({
            url: t.getNetAddresss(this.data.urlStr),
            success: function(a) {
                a.data.result ? n.setData({
                    list: a.data.data
                }) : t.tips(a.data.msg);
            }
        });
    },
    toBind: function() {
        "wisdom" != this.data.option ? wx.navigateTo({
            url: "/packageF/silverPointPay/addSilverBank/addSilverBank"
        }) : wx.navigateTo({
            url: "/packageF/others/wisdom/addWisdomBank/addWisdomBank?to=SilverBankListwisdom"
        });
    },
    relieve: function(n) {
        var a = this, i = n.currentTarget.dataset.id;
        wx.showModal({
            content: "是否确定解绑此银行卡",
            success: function(n) {
                t._getNetWork({
                    url: t.getNetAddresss("plugin.silver-point-pay.frontend.union-card.unbind-card"),
                    data: {
                        pay_union_card_id: i
                    },
                    success: function(n) {
                        n.data.result ? a.getData() : t.tips(n.data.msg);
                    }
                });
            },
            fail: function(n) {
                t.tips(n);
            }
        });
    }
});